package com.easypreview.preview.service.channel.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.easypreview.preview.domain.channel.Channel;
import com.easypreview.preview.service.channel.ChannelService;
import com.easypreview.preview.util.page.Page;
import com.easypreview.preview.persist.channel.ChannelRepository;
/**
 * 频道业务实现类
 * @author ajian
 *
 */
@Service
public class ChannelServiceImpl implements ChannelService {

	@Autowired
	private ChannelRepository channelRepository;

	@Override
	public Channel get(String id) {
		return channelRepository.get(id);
	}

	@Override
	public Channel queryUniqueByPath(String path) {
		return channelRepository.queryUniqueByPath(path);
	}

	@Override
	public Channel queryUniqueByName(String name) {
		return channelRepository.queryUniqueByName(name);
	}

	@Override
	public Page<Channel> queryPage(Page<Channel> page) {
		return channelRepository.queryPage(page);
	}

	@Override
	public List<Channel> queryTop() {
		return channelRepository.queryTop();
	}

	@Override
	public Page<Channel> queryPageTop(Page<Channel> page) {
		return channelRepository.queryPageTop(page);
	}

	@Override
	public void save(Channel channel) {
		channelRepository.save(channel);

	}

	@Override
	public void delete(String id) {
		channelRepository.delete(id);

	}

	@Override
	public void update(Channel channel) {
		channelRepository.update(channel);

	}

	@Override
	public Channel getMostSimilar(String title) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<Channel> query(Object object) {
		return channelRepository.query(object);
	}

	@Override
	public List<String> hotKeyWord(Channel channel) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Page<Channel> queryPageChildById(Page<Channel> page, String id) {
		return channelRepository.queryPageChildById(page, id);
	}

	@Override
	public List<Channel> queryChildById(String id) {
		return channelRepository.queryChildById(id);
	}

	@Override
	public List<Channel> queryChannels() {
		return channelRepository.queryChannels();
	}

	@Override
	public Map<String, String> classfiyToChannelname() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Channel getFatherByFatherId(String fatherId) {
		return channelRepository.getFatherByFatherId(fatherId);
	}

}
